//
//  LBCollectionViewCell.m
//  MyProject
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "LBCollectionViewCell.h"

#define WIDTH ([UIScreen mainScreen].bounds.size.width/375)
#define HEIGH ([UIScreen mainScreen].bounds.size.height/667)
@implementation LBCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.bgimage = [[UIImageView alloc]init];
        [self.contentView addSubview:self.bgimage];
        
        self.blackV = [[UIView alloc] init];
        _blackV.alpha = 0.2;
        _blackV.backgroundColor = [UIColor blackColor];
        [self.bgimage addSubview:_blackV];
        
        self.titleLabel = [[UILabel alloc]init];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.font = [UIFont boldSystemFontOfSize:25 * WIDTH * HEIGH ];
        _titleLabel.numberOfLines = 0;
        [_titleLabel sizeToFit];
        [self.bgimage addSubview:self.titleLabel];
        
        self.commenImage = [[UIImageView alloc]init];
        _commenImage.layer.cornerRadius = 15;
        _commenImage.clipsToBounds = YES;
        [self addSubview:self.commenImage];
        
        self.commenLabel = [[UILabel alloc]init];
        _commenLabel.textColor = [UIColor whiteColor];
        _commenLabel.font = [UIFont systemFontOfSize:17 * WIDTH * HEIGH];
        [self addSubview:self.commenLabel];
        
        self.decribLabel = [[UILabel alloc]init];
        _decribLabel.textColor = [UIColor whiteColor];
        _decribLabel.font = [UIFont systemFontOfSize:17 * WIDTH * HEIGH];
        _decribLabel.numberOfLines = 0;
        [_decribLabel sizeToFit];
        [self addSubview:self.decribLabel];
        
    }
    return  self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    _bgimage.frame = CGRectMake(0, 0, self.contentView.bounds.size.width, 300*HEIGH);
    _blackV.frame = _bgimage.bounds;
    _titleLabel.frame = CGRectMake(30 * WIDTH, 100 * HEIGH, self.contentView.bounds.size.width-60 * WIDTH, 80 * HEIGH);
    _commenImage.frame = CGRectMake(10 * WIDTH, 180 * HEIGH, 30 * WIDTH, 30 * HEIGH);
    _commenLabel.frame = CGRectMake(50 * WIDTH, 185 * HEIGH, 200 * WIDTH, 20 * HEIGH);
    _decribLabel.frame = CGRectMake(10 * WIDTH , 205 * HEIGH, self.contentView.bounds.size.width-20 * WIDTH, 95 * HEIGH);
    
    
}


@end
